# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: rubicon <rubicon@mailo.com>
pkgname=picat
pkgver=3.2.0
_pkgver="${pkgver//./}"
pkgrel=0
pkgdesc="Logic-based multi-paradigm programming language"
url="http://picat-lang.org/"
arch="all"
license="MPL-2.0"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://picat-lang.org/download/picat${_pkgver}_src.tar.gz
	fix-fileno-usage.patch
	"
builddir="$srcdir"/Picat/emu

build() {
	make -f Makefile.linux64
}

check() {
	./picat --version
}

package() {
	local extdir="$srcdir"/Picat
	install -Dv picat -t "$pkgdir"/usr/bin/
	install -Dvm644 "$extdir"/lib/* \
		-t "$pkgdir"/usr/lib/"$pkgname"
	install -Dvm644 "$extdir"/README \
		"$extdir"/LICENSE "$extdir"/doc/* \
		-t "$pkgdir"/usr/share/doc/"$pkgname"
	mv -v "$extdir"/exs \
		"$pkgdir"/usr/share/doc/"$pkgname"/examples
}

sha512sums="
6a54a18293c42b6e02ce0855a030e8c470817b41a006ca030a423abae2225642e412348f23b62d463ad1e3a97feddccf6c43f4ba81b7a7d0f320bd2c5a414bf3  picat-3.2.0.tar.gz
82c43ff6625dccce2919c5e1b26eb4dc047d95ee9bc0a2cd5b42053f2b0a2dd54457c650d59c8eccdb4ce0e7500950e43b97a05f900c459267e4132eda691789  fix-fileno-usage.patch
"
